﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CommonCls
{
    public partial class frmServiceOpGress : Form
    {
        public frmServiceOpGress(ServiceEventArgs e )
        {
            InitializeComponent();
            SetArgs(e);
        }
        public void SetArgs(ServiceEventArgs e)
        { 
          txtDesc.Text = string.Format("{0} {1}({2})",
                e.Status == SERVICE_STATUS.START ?
                Properties.Settings.Default.ServiceStartDesc :
                Properties.Settings.Default.ServiceStop,
                e.ServiceDesc, e.ServiceName);
          proGress.Value = 0;
          _Timer.Enabled = true;
          _Timer.Start();
        }
        private void _Timer_Tick(object sender, EventArgs e)
        {
            proGress.Value += 1;
            if (10 == proGress.Value)
            {
                _Timer.Enabled = false;
                _Timer.Stop();
            }
        }
    }
}
